package ru.urfc.portal.ui.client.googlets.client.documents;

import com.extjs.gxt.ui.client.widget.form.CheckBox;
import com.extjs.gxt.ui.client.widget.form.DateField;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Widget;

import ru.urfc.portal.ui.client.BaseDocument;
import ru.urfc.portal.ui.client.descriptor.GridDescriptor;

public class DocsOrder extends BaseDocument {

	interface Binder extends UiBinder<Widget, DocsOrder> {}
	private static Binder binder = GWT.create(Binder.class);
	
	@UiField CheckBox reconciliation;
	@UiField DateField reconcileFrom;
	@UiField DateField reconcileTo;
	@UiField CheckBox spectrReport;
	@UiField CheckBox proformaInvoices;
	@UiField DateField proformaFrom;
	@UiField DateField proformaTo;
	@UiField CheckBox invoices;
	@UiField DateField invoicesFrom;
	@UiField DateField invoicesTo;
	@UiField TextField<String> address;
	
	@Override
	protected void init(GridDescriptor descriptor) {
		initWidget(binder.createAndBindUi(this));

		descriptor.setAddFieldPathPrefix("date");
		descriptor.addBoolField("reconciliation", reconciliation);
		descriptor.addDateField("reconcileFrom", reconcileFrom);
		descriptor.addDateField("reconcileTo", reconcileTo);
		descriptor.addBoolField("spectrReport", spectrReport);
		descriptor.addBoolField("proformaInvoices", proformaInvoices);
		descriptor.addDateField("proformaFrom", proformaFrom);
		descriptor.addDateField("proformaTo", proformaTo);
		descriptor.addBoolField("invoices", invoices);
		descriptor.addDateField("invoicesFrom", invoicesFrom);
		descriptor.addDateField("invoicesTo", invoicesTo);
		descriptor.addTextField("address", address);
		descriptor.setAddFieldPathPrefix("");
	}

}
